<template>
    <example :template-code="templateString">
        <template #describe>
            <t :id="`${$t('日期时间区间选择')}`">{{ $t('日期时间区间选择') }}</t>
        </template>
        <div style="color:#999;">
            <div style="width: 500px;margin-right:20px;">
                <p style="color:#666;">普通用法：</p>
                <sib-item v-model="value1" :props="props1"></sib-item>
                <p>{{ value1 || '--' }}</p>
            </div>
            <div style="width: 500px;margin-right:20px;">
                <p style="color:#666;">设置默认时刻：</p>
                <sib-item v-model="value2" :props="props2"></sib-item>
                <p>{{ value2 || '--' }}</p>
            </div>
        </div>
    </example>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value1 = ref(null);
        const value2 = ref(null);
        const props1 = reactive({
            type: 'datetimerange',
        });
        const props2 = reactive({
            type: 'datetimerange',
            defaultTime: ['13:50:20', new Date()],
        });

        return {
            value1,
            value2,
            props1,
            props2,
            templateString: `<template>
    <div>
        <div style="width: 500px;">
            <p>普通用法：</p>
            <sib-item v-model="value1" :props="props1"></sib-item>
            <p>{{ value1 || '--' }}</p>
        </div>
        <div style="width: 500px;">
            <p>设置默认时刻：</p>
            <sib-item v-model="value2" :props="props2"></sib-item>
            <p>{{ value2 || '--' }}</p>
        </div>
    </div>
</template>

<script>
import { ref, reactive } from 'vue';

export default {
    setup() {
        const value1 = ref(null);
        const value2 = ref(null);
        const props1 = reactive({
            type: 'datetimerange',
        });
        const props2 = reactive({
            type: 'datetimerange',
            defaultTime: ['13:50:20', new Date()],
        });

        return { value1, value2, props1, props2 };
    },
};
<\/script>`,
        };
    },
};
</script>
